import request from '@/utils/request';

export class UserApi {

    static permission = {
        findPage: '/system/user/findPage',
        findById: '/system/user/findById',
        save: '/system/user/save',
        update: '/system/user/update',
        delete: '/system/user/delete',
        enabled: '/system/user/enabled',
        locked: '/system/user/locked',
        resetPwd: '/system/user/modifyPassword',
    };

    static findPage(params) {
        return request({
            url: this.permission.findPage,
            method: 'post',
            data: params
        });
    };

    static findById(params) {
        return request({
            url: this.permission.findById,
            method: 'post',
            data: params
        });
    };

    static save(params) {
        return request({
            url: this.permission.save,
            method: 'post',
            data: params
        });
    };

    static update(params) {
        return request({
            url: this.permission.update,
            method: 'post',
            data: params
        });
    };

    static delete(params) {
        return request({
            url: this.permission.delete,
            method: 'post',
            data: params
        });
    };

    static enabled(params) {
        return request({
            url: this.permission.enabled,
            method: 'post',
            data: params
        });
    };

    static locked(params) {
        return request({
            url: this.permission.locked,
            method: 'post',
            data: params
        });
    };

    static rePassword(params) {
        return request({
            url: this.permission.resetPwd,
            method: 'post',
            data: params
        });
    }
}
